package com.you.atlas.web.member.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.member.service.FollowService;
import com.you.common.webx.AuthContext;

public class Follow {

    @Autowired
    private FollowService followService;

    public void execute(@Param(name = "masterMemberId") Long masterMemberId, Navigator navigator) {

        Long fansMemberId = AuthContext.getContext().getMemberId();
        followService.follow(masterMemberId, fansMemberId);
        navigator.redirectTo("memberModule").withTarget("home.vm").withParameter("id", masterMemberId.toString());
    }
}
